<html>
<head>
    <link rel="stylesheet" type="text/css" href="Css/index.css" />
	<link rel="stylesheet" type="text/css" href="Css/newAccount.css" />
	<script type="text/javascript" src="js/jquery.js"></script>
	<script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/sha256.js"></script>
</head>
<body id="pageBody">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<div id="bannerHolder">
    <div id="pageHead">
        <h1 id="Logo">
            <a href="index.php">SuperScraper</a>
        </h1>
        <div id="searchBar">
            <form rel="async" action="ajax/searchcall">
                <input type="hidden" name="dff_view" value="grid">
                <input type="text" name="search_field" size="45" maxlength="50"><input type="button" value="Go!" onclick="no">
            </form>
        </div>
        <div id="rfloat">
            <u1 id="account">
                <a id="accountdetails" href="index.php">
                    Back to Home
                </a>
            </u1>
        </div>
    </div>

</div>
    <div id="globalContainer" class="uiContextualLayerParent">
          <div id="content" class="page_content">
            <div id="mainContainer" >
                 <div id="contentArea" role="main">
		
                 <div id = "NewAccountForm">
				 <div id = "FormContainer">
					<div id=headHolder>
					<font id="createAccount">Create a new Account</font>
					<br>
					<font id="barelyLegal">Its free and barely legal!</font>
					</div>
					<form name="register" action="PHP/registerAccount.php" method="get">
						<input class= "inputBox" type="text" name="user" id="user" placeholder="Desired Username">
						<br>
						<input class= "inputBox" type="text" name="Fname" id="Fname" placeholder="Your First Name">
						<br>
						<input class= "inputBox" type="text" name="Lname" id="Lname" placeholder="Your Last Name">
						<br>
						<input class= "inputBox" type="password" name="password" id="pass" placeholder="Password"> 
						<br>
						<input id="submit_button" type="submit" value="Submit">
					</form>
                 </div>
				 </div>
                 </div>

             </div>
            </div>
          </div>
    </div>
	<div id= "koalaAd">	 
	 </div>
</body>
</html>
<script>
//submit handler to encrypt username and password before sending the form
$('form').submit(function() {
            var txt = $('#pass');
			txt.val(CryptoJS.SHA256(txt.val()));
			var usr = $('#user');
			usr.val(CryptoJS.SHA256(usr.val()));
			
			document.cookie = "usr=" + usr.val() +
			"; " ;
			document.cookie = "password=" + txt.val() +
			"; " ;
			document.cookie = "Fname=" + $('#Fname').val() +
			"; " ;
			document.cookie = "Lname=" + $('#Lname').val() +
			"; " ;
		   return true;
    });
	
</script>